import 'package:flutter/material.dart';
import 'my_image.dart';
import 'my_svg.dart';

Widget MyIcon(String name,
    {bool? svgIcon, double? width, double? height, BoxFit? fit, Color? color}) {
  bool _svgIcon = false;

  if (svgIcon != null) {
    _svgIcon = svgIcon;
  } else {
    _svgIcon = name.contains(".svg");
  }

  return _svgIcon
      ? MySvg(name, width: width, height: height, fit: fit, color: color)
      : MyImage(name, width: width, height: height, fit: fit, color: color);
}
